// pages/index1/index1.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    CheckType1: '专项检查',
    CheckType2: '日常检查',
    // CheckType:'',
    cardCur: 0,
    swiperList: [{
      id: 0,
      type: 'image',
      url: '../../imgs/banner5.jpg'
    }, {
      id: 1,
      type: 'image',
        url: '../../imgs/banner3.jpg',
    }, {
      id: 2,
      type: 'image',
        url: '../../imgs/banner4.jpg'
    }],
    
    

  },
  //跳转事故页面
  accident:function(){
    wx.navigateTo({
      url: '../accidentList/accidentList',
    })
  },
  //跳转事件页面
  event:function(){
    wx.navigateTo({
      url: '../event/event',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  specialInspection: function () {

    wx.navigateTo({
      url: '../specialInspection/specialInspection',
    })
  },
  //检查类别跳转
  submitClick1: function () {
    wx.setStorageSync('CheckType', this.data.CheckType1)
    var CheckType=this.data.CheckType1
    console.log('CheckType=' + this.data.CheckType1)
    // wx.navigateTo({
    //   url: '../specialInspection1/specialInspection1?CheckType='+CheckType,
    // })
    wx.navigateTo({
      url: '../inspectionList/inspectionList',
    })
    this.setData({
      modalName: null
    })
  },
  submitClick2: function () {
    var CheckType=this.data.CheckType2
    // wx.setStorageSync('CheckType', this.data.CheckType2)
    console.log('CheckType=' + this.data.CheckType2)
    wx.navigateTo({
      url: '../specialInspection1/specialInspection1?CheckType='+CheckType,
    })
    this.setData({
      modalName: null
    })
  },
  showModal(e) {
    this.setData({
      modalName: e.currentTarget.dataset.target
    })
  },
  hideModal(e) {
    this.setData({
      modalName: null
    })
  },
  ChooseCheckbox(e) {
    let items = this.data.checkbox;
    let values = e.currentTarget.dataset.value;
    for (let i = 0, lenI = items.length; i < lenI; ++i) {
      if (items[i].value == values) {
        items[i].checked = !items[i].checked;
        break
      }
    }
    this.setData({
      checkbox: items
    })
  },
 
  onShow: function () {

  }
})